/**
* \file NetworkContext.cpp
* \brief NetworkContext decleration class for windows plugin
* \author Edouard ROGE
* \date 12 Novembre 2013
*/

#include "TCPSocket.h"
#include "TCPServerSocket.h"
#include "UDPSocket.h"
#include "NetworkContext.h"
#include "Core/Profile/Profiler.h"
#include "Core/Profile/CodeProfile.h"

NetworkContext::NetworkContext()
{
}

NetworkContext::~NetworkContext()
{
}

ITCPSocket * NetworkContext::CreateTCPSocket() const
{
	PROFILE("CreateTCPSocket");
	return new TCPSocket();
}

void NetworkContext::DestroyTCPSocket(ITCPSocket * _pSocket) const
{
	if (_pSocket)
	{
		delete (TCPSocket*)_pSocket;
	}
		
}

ITCPServerSocket *NetworkContext::CreateTCPServerSocket() const
{
	return new TCPServerSocket();

}

void NetworkContext::DestroyTCPServerSocket(ITCPServerSocket * _pSocket) const
{
	if (_pSocket)
		delete (TCPServerSocket*)_pSocket;
}

IUDPSocket * NetworkContext::CreateUDPSocket() const
{
	return new UDPSocket();
}

void NetworkContext::DestroyUDPSocket(IUDPSocket * _pSocket) const
{
	if (_pSocket)
		delete (UDPSocket*)_pSocket;
}
